package com.cuit.qx.controller;


import com.cuit.qx.service.ConfigService;
import com.cuit.qx.utils.ReturnData;
import com.cuit.qx.utils.ReturnStateCode;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

/**
 * <p>
 * 系统配置
 * </p>
 *
 * @author lcj
 * @since 2021-11-23
 */
@CrossOrigin(origins = "*", maxAge = 3600)
@RestController
@RequestMapping("/api/config")
public class ConfigController {

    @Resource
    private ConfigService configService;

    @RequestMapping("/list")
    public ReturnData getData(){
        Map<String, Object> map = configService.getData();
        if (!map.isEmpty()){
            return new ReturnData(ReturnStateCode.SUCCEE,map);
        }
        return new ReturnData(ReturnStateCode.SUCCEEBUT);
    }

}
